package Dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Scanner;
public class Test {
    public static void mainInterface() throws SQLException, ClassNotFoundException {
        System.out.println("****主界面*****************");
        System.out.println("*1、查询表数据**************");
        System.out.println("*2、增加表数据**************");
        System.out.println("*3、删除表数据**************");
        System.out.println("*4、修改表数据**************");
        System.out.println("***输入编号即可执行**********");
        Scanner in =new Scanner(System.in);
        int i=in.nextInt();
        switch (i){
            case 1:tableNo();break;
            case 2:jdbcUtil.addData();mainInterface();break;
            case 3:jdbcUtil.deleteData();mainInterface();break;
            case 4:jdbcUtil.updata();mainInterface();break;
            default :
                System.out.println("请重新输入");mainInterface();break;
        }
    }
    public static void tableNo() throws SQLException, ClassNotFoundException {
        System.out.println("****表列表************");
        System.out.println("*1、业主表*************");
        System.out.println("*2、房屋表*************");
        System.out.println("*3、管理表*************");
        System.out.println("*4、管理情况表**********");
        System.out.println("*5、管理员表************");
        System.out.println("*6、物业费信息表*********");
        System.out.println("*7、楼宇表**************");
        System.out.println("*0、返回主界面***********");
        System.out.println("***输入编号即可查看******");
        Scanner in =new Scanner(System.in);
        int i=in.nextInt();
        switch (i){
            case 1:jdbcUtil.queryYZ();tableNo();break;
            case 2:jdbcUtil.queryFW();tableNo();break;
            case 3:jdbcUtil.queryGL();tableNo();break;
            case 4:jdbcUtil.queryGLQK();tableNo();break;
            case 5:jdbcUtil.queryGLY();tableNo();break;
            case 6:jdbcUtil.queryWYFXX();tableNo();break;
            case 7:jdbcUtil.queryLY();tableNo();break;
            case 0:mainInterface();break;
            default :
                System.out.println("请重新输入");tableNo();break;
        }
    }
    public static void main(String[] args) throws Exception {
        mainInterface();
    }
}

